const request = require('../utils/request')
// 注册   这里的data不写params全部写data作为参数的传递

export function denglu(data){
  return request({
    url:'/program/login',
    method:'post',
    data,
   
  })
}
export function list(data){
  return request({
    url:'/system/ApaEquipment/list',
    method:'get',
    data,
    header:{'Authorization': wx.getStorageSync('token')}
  })
}
export function xiugai(data){
  return request({
    url:'/program/equipment/update',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token')}
  })
}
export function zidianlist(data){
  return request({
    url:'/program/dict/type',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token')}
  })
}
export function dianya(data){
  return request({
    url:'/program/dict/data',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token'),'content-type':'application/x-www-form-urlencoded'}
  })
}
export function addeq(data){
  return request({
    url:'/system/ApaEquipment',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token')}
  })
}
// export function deleq(data){
//   return request({
//     url:'/program/equipment/delete',
//     method:'post',
//     data,
//     header:{'Authorization': wx.getStorageSync('token'),'content-type':'application/x-www-form-urlencoded'}
//   })
// }
export function out(data){
  return request({
    url:'/program/logout',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token')}
  })
}
export function getinfo(data){
  return request({
    url:'/getUser',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token')}
  })
}
//获取逆变一体机列表
export function eqlist(data){
  return request({
    url:'/program/getThirdList',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token'),'content-type':'application/x-www-form-urlencoded'}
  })
}
//获取逆变一体机数据
export function eqdata(data){
  return request({
    url:'/program/getThirdData',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token'),'content-type':'application/x-www-form-urlencoded'}
  })
}

export function info(data){
  return request({
    url:'/getinfo',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token')}
  })
}
//小程序首页设备数量
export function homenum(data){
  return request({
    url:'/program/countInfo',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token'),'content-type':'application/x-www-form-urlencoded'}
  })
}
//获取用户信息
export function homegetinfo(data){
  return request({
    url:'/program/getInfo',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token')}
  })
}
//用户查询所有设备
export function alleq(data){
  return request({
    url:'/program/userId',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token'),'content-type':'application/x-www-form-urlencoded'}
  })
}
//用户查询设备详情
export function eqdetail(data){
  return request({
    url:'/program/eqId',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token'),'content-type':'application/x-www-form-urlencoded'}
  })
}
//修改密码
export function password(data){
  return request({
    url:'/program/updatePwd',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token'),'content-type':'application/x-www-form-urlencoded'}
  })
}
//消息列表
export function msglist(data){
  return request({
    url:'/program/getMessageList',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token'),'content-type':'application/x-www-form-urlencoded'}
  })
}
//消息列表
export function deleq(data){
  return request({
    url:'/program/deleteEquipment',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token'),'content-type':'application/x-www-form-urlencoded'}
  })
}
//获取字典
export function fontlist(data){
  return request({
    url:'/program/dictType',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token'),'content-type':'application/x-www-form-urlencoded'}
  })
}
//下发数据
export function senddata(data){
  return request({
    url:'/program/xiafaEquipment',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token')}
  })
}
//修改昵称
export function newname(data){
  return request({
    url:'/program/edit',
    method:'post',
    data,
    header:{'Authorization': wx.getStorageSync('token')}
  })
}






